
import pymysql
from douyin_pro import settings

def connect():
    conn = pymysql.connect(host=settings.DB_HOST, database=settings.DB_DATABASE, user=settings.DB_USER,
                                password=settings.DB_PASSWORD)
    cursor = conn.cursor()

    return conn, cursor

def close(conn, cursor):
    cursor.close()
    conn.close()